import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '参赛身份',
    align:"center",
    dataIndex: 'shenf'
   },
   {
    title: '姓名',
    align:"center",
    dataIndex: 'xingm'
   },
   {
    title: '其它参赛人',
    align:"center",
    dataIndex: 'qitcsr'
   },
   {
    title: '性别',
    align:"center",
    dataIndex: 'xingb_dictText'
   },
   {
    title: '证件类型',
    align:"center",
    dataIndex: 'zhengjlx_dictText'
   },
   {
    title: '证件号码',
    align:"center",
    dataIndex: 'zhengjhm'
   },
   {
    title: '联系电话',
    align:"center",
    dataIndex: 'lianxdh'
   },
   {
    title: '邮箱',
    align:"center",
    dataIndex: 'youx'
   },
   {
    title: '单位名称',
    align:"center",
    dataIndex: 'danwmc'
   },
   {
    title: '归属地',
    align:"center",
    dataIndex: 'guisd_dictText'
   },
   {
    title: '详细地址',
    align:"center",
    dataIndex: 'xiangxdz'
   },
   {
    title: '个人照片',
    align:"center",
    dataIndex: 'gerzp',
    customRender:render.renderImage,
   },
   {
    title: '证件照片',
    align:"center",
    dataIndex: 'zhengjzp',
    customRender:render.renderImage,
   },
   {
    title: '证书照片',
    align:"center",
    dataIndex: 'zhengszp',
    customRender:render.renderImage,
   },
   {
    title: '个人简介',
    align:"center",
    dataIndex: 'gerjj',
   },
   {
    title: '优秀案例',
    align:"center",
    dataIndex: 'youxal',
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '参赛身份',
    field: 'shenf',
    component: 'Input',
  },
  {
    label: '姓名',
    field: 'xingm',
    component: 'Input',
  },
  {
    label: '其它参赛人',
    field: 'qitcsr',
    component: 'Input',
  },
  {
    label: '性别',
    field: 'xingb',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"sex"
     },
  },
  {
    label: '证件类型',
    field: 'zhengjlx',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"zhengjlx"
     },
  },
  {
    label: '证件号码',
    field: 'zhengjhm',
    component: 'Input',
  },
  {
    label: '联系电话',
    field: 'lianxdh',
    component: 'Input',
  },
  {
    label: '邮箱',
    field: 'youx',
    component: 'Input',
  },
  {
    label: '单位名称',
    field: 'danwmc',
    component: 'Input',
  },
  {
    label: '归属地',
    field: 'guisd',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"saiq"
     },
  },
  {
    label: '详细地址',
    field: 'xiangxdz',
    component: 'InputTextArea',
  },
  {
    label: '个人照片',
    field: 'gerzp',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '证件照片',
    field: 'zhengjzp',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '证书照片',
    field: 'zhengszp',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '个人简介',
    field: 'gerjj',
    component: 'JUpload',
    componentProps:{
     },
  },
  {
    label: '优秀案例',
    field: 'youxal',
    component: 'JUpload',
    componentProps:{
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  shenf: {title: '参赛身份',order: 0,view: 'text', type: 'string',},
  xingm: {title: '姓名',order: 1,view: 'text', type: 'string',},
  qitcsr: {title: '其它参赛人',order: 2,view: 'text', type: 'string',},
  xingb: {title: '性别',order: 3,view: 'list', type: 'string',dictCode: 'sex',},
  zhengjlx: {title: '证件类型',order: 4,view: 'list', type: 'string',dictCode: 'zhengjlx',},
  zhengjhm: {title: '证件号码',order: 5,view: 'text', type: 'string',},
  lianxdh: {title: '联系电话',order: 6,view: 'text', type: 'string',},
  youx: {title: '邮箱',order: 7,view: 'text', type: 'string',},
  danwmc: {title: '单位名称',order: 8,view: 'text', type: 'string',},
  guisd: {title: '归属地',order: 9,view: 'list', type: 'string',dictCode: 'saiq',},
  xiangxdz: {title: '详细地址',order: 10,view: 'textarea', type: 'string',},
  gerzp: {title: '个人照片',order: 11,view: 'image', type: 'string',},
  zhengjzp: {title: '证件照片',order: 12,view: 'image', type: 'string',},
  zhengszp: {title: '证书照片',order: 13,view: 'image', type: 'string',},
  gerjj: {title: '个人简介',order: 14,view: 'file', type: 'string',},
  youxal: {title: '优秀案例',order: 15,view: 'file', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}